<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>让CSS flex布局最后一行列表左对齐的N种方法</title>
    <style>
      .container {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        margin-right: -10px;
      }
      .list {
        width: 100px;
        height: 100px;
        background-color: skyblue;
        margin: 15px 10px 0 0;
      }
      /* 和列表一样的宽度和margin值 */
      .container > i {
        width: 100px;
        margin-right: 10px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="list"></div>
      <div class="list"></div>
      <div class="list"></div>
      <div class="list"></div>
      <div class="list"></div>
      <div class="list"></div>
      <div class="list"></div>
      <i></i><i></i><i></i><i></i><i></i>
    </div>
  </body>
</html>
